﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes.orders {

    public class VisitorHelpOrder extends AbstractOrder {

        public static const UNCLAIMED:String = "unclaimed";
        public static const REJECTED:String = "rejected";
        public static const CLAIMED:String = "claimed";
        public static const INITIATED:String = "initiated";
        public static const HELP_TARGETS:String = "helpTargets";
        public static const STATUS:String = "status";

        private var m_helpTargets:Array;
        private var m_claimedHelpTargets:Array;
        private var m_status:String;

        public function VisitorHelpOrder(_arg1:String, _arg2:String, _arg3:Array=null, _arg4:String=null){
            super(_arg1, _arg2, OrderType.VISITOR_HELP, _arg4);
            this.m_helpTargets = ((_arg3) || ([]));
            setState(OrderStates.PENDING);
            this.m_claimedHelpTargets = new Array();
        }
        public function addHelpTarget(_arg1:uint):void{
            this.m_helpTargets.push(_arg1);
        }
        public function setHelpTargets(_arg1:Array):void{
            this.m_helpTargets = _arg1;
        }
        public function getHelpTargets():Array{
            return (this.m_helpTargets);
        }
        public function claimHelpTarget(_arg1:uint):void{
            this.m_claimedHelpTargets.push(_arg1);
        }
        public function isHelpTargetClaimed(_arg1:uint):Boolean{
            if (this.m_claimedHelpTargets.indexOf(_arg1) > -1){
                return (true);
            };
            return (false);
        }
        public function getStatus():String{
            return (this.m_status);
        }
        public function setStatus(_arg1:String):void{
            this.m_status = _arg1;
        }
        override public function setParams(_arg1:Object):void{
            super.setParams(_arg1);
            this.m_helpTargets = ((_arg1[HELP_TARGETS]) || ([]));
            this.m_status = _arg1[STATUS];
        }
        override public function getParams():Object{
            var _local1:Object = super.getParams();
            _local1[HELP_TARGETS] = this.m_helpTargets;
            _local1[STATUS] = this.m_status;
            return (_local1);
        }
        override public function updateOrder(_arg1:Object):void{
            this.m_helpTargets = ((_arg1[HELP_TARGETS]) || ([]));
        }

    }
}//package Classes.orders 
